package com.ybkj.o2o.zhuanche.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ybkj.o2o.zhuanche.entity.CarTypeDetail;
import com.ybkj.o2o.zhuanche.mapper.CarTypeDetailMapper;
import com.ybkj.o2o.zhuanche.service.CarTypeDetailService;

@Service
public class DefaultCarTypeDetailService implements CarTypeDetailService {

  @Autowired
  private CarTypeDetailMapper carTypeDetailMapper;

  @Override
  public List<CarTypeDetail> findAll(String appKey) {
    return carTypeDetailMapper.selectAll(appKey);
  }

  @Override
  public int updateCarTypeDetail(Long id, String photo, String priceDetail,
      String startPrice, String timePrice, String miliagePrice, String appKey) {
    return carTypeDetailMapper.update(id,photo,priceDetail, startPrice,timePrice, miliagePrice, appKey);
  }

  @Override
  public int insertCarTypeDetail(CarTypeDetail carTypeDetail) {
    return carTypeDetailMapper.insert(carTypeDetail);
  }

  @Override
  public int deleteByCarTypeId(Long carTypeId, String appKey) {
    return carTypeDetailMapper.deleteByCarTypeId(carTypeId,appKey);
  }
  
  @Override
  public int clear(String appKey) {
    return carTypeDetailMapper.deleteByAppKey(appKey);
  }

}
